import { post,get } from '@/request/http'
import store from '@/store'

// 获取  场站列表  查询数据
export const getStationService = (data) =>
  post(
    '/FTKJWLHYPT/base/queryStation',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            staCd: data.staCd,
            staCname: data.staCname,
            staEname: data.staEname,
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: data.PageIndexs
        },
        PageSizes: {
          FTKJWLHYPT: data.PageSizes
        }
      }
    }
  )

// 获取  场站列表  新增
export const addStationService = (data) =>
  post(
    '/FTKJWLHYPT/base/addStation',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            staCd: data.staCd,
            staCname: data.staCname,
            staEname: data.staEname,
            staCtyuuid: data.staCtyuuid,
            staReguuid: data.staReguuid,
            staCtuuid: data.staCtuuid,
            tmnCtyCode: data.tmnCtyCode,
            staIsvalid: data.staIsvalid,
            staX: data.staX,
            staY: data.staY,
            staRemark: data.staRemark,
            staDepId: store.state.user.DPTID_DX_H,
            staFltuuid: store.state.user.FLT_UUID_DX_H,
            staInsertuser: store.state.user.USR_CODE_DX_H,
          }
        }
      }
    }
  )

// 获取  场站列表  编辑
export const editStationService = (data) =>
  post(
    '/FTKJWLHYPT/base/editStation',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            staUuid: data.staUuid,
            staCd: data.staCd,
            staCname: data.staCname,
            staEname: data.staEname,
            staCtyuuid: data.staCtyuuid,
            staReguuid: data.staReguuid,
            staCtuuid: data.staCtuuid,
            tmnCtyCode: data.tmnCtyCode,
            staIsvalid: data.staIsvalid,
            staX: data.staX,
            staY: data.staY,
            staRemark: data.staRemark,
            staDepId: store.state.user.DPTID_DX_H,
            staFltuuid: store.state.user.FLT_UUID_DX_H,
            staLstupduser: store.state.user.USR_CODE_DX_H,
          }
        }
      }
    }
  )

// 获取  场站列表  删除
export const delStationService = (data) =>
  post(
    '/FTKJWLHYPT/base/delStation',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            staUuid: data.staUuid,
          }
        }
      }
    }
  )

// 获取  国家  下拉
export const getNationService = () =>
  get(
    '/FTKJWLHYPT/dropDown/getCountries',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
          }
        }
      }
    }
  )

// 获取  省  下拉
export const getProvinceService = (data) =>
  post(
    '/FTKJWLHYPT/dropDown/selectPrvInfosByPrvCtyCd',
    {
      ctycd: data.ctycd
    }
  )

// 获取  市  下拉
export const getCityService = (data) =>
  post(
    '/FTKJWLHYPT/dropDown/selectCityByPrCode',
    {
      pvCode: data.pvCode
    }
  )
